package com.ruoyi.system.service.city.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.city.CityInfo;
import com.ruoyi.system.mapper.city.CityInfoMapper;
import com.ruoyi.system.service.city.ICityInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 资讯Service业务层处理
 * 
 * @author cjq
 * @date 2023-10-15
 */
@Service
public class CityInfoServiceImpl implements ICityInfoService
{
    @Autowired
    private CityInfoMapper cityInfoMapper;

    /**
     * 查询资讯
     * 
     * @param infoId 资讯主键
     * @return 资讯
     */
    @Override
    public CityInfo selectCityInfoByInfoId(Long infoId)
    {
        return cityInfoMapper.selectCityInfoByInfoId(infoId);
    }

    /**
     * 查询资讯列表
     * 
     * @param cityInfo 资讯
     * @return 资讯
     */
    @Override
    public List<CityInfo> selectCityInfoList(CityInfo cityInfo)
    {
        return cityInfoMapper.selectCityInfoList(cityInfo);
    }

    /**
     * 新增资讯
     * 
     * @param cityInfo 资讯
     * @return 结果
     */
    @Override
    public int insertCityInfo(CityInfo cityInfo)
    {
        cityInfo.setCreateTime(DateUtils.getNowDate());
        return cityInfoMapper.insertCityInfo(cityInfo);
    }

    /**
     * 修改资讯
     * 
     * @param cityInfo 资讯
     * @return 结果
     */
    @Override
    public int updateCityInfo(CityInfo cityInfo)
    {
        return cityInfoMapper.updateCityInfo(cityInfo);
    }

    /**
     * 批量删除资讯
     * 
     * @param infoIds 需要删除的资讯主键
     * @return 结果
     */
    @Override
    public int deleteCityInfoByInfoIds(Long[] infoIds)
    {
        return cityInfoMapper.deleteCityInfoByInfoIds(infoIds);
    }

    /**
     * 删除资讯信息
     * 
     * @param infoId 资讯主键
     * @return 结果
     */
    @Override
    public int deleteCityInfoByInfoId(Long infoId)
    {
        return cityInfoMapper.deleteCityInfoByInfoId(infoId);
    }
}
